package com.deep.test

import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.linalg.Vector
import org.apache.spark.mllib.regression.LabeledPoint

/**
 * @author sw
 * @create 2023-05-30 15:14
 */
object Test03 {
  def main(args: Array[String]): Unit = {
    val dv : Vector = Vectors.dense(2.0, 0.0, 8.0)
    val sv1 = Vectors.sparse(3, Array(0, 2), Array(2.0, 8.0))
    val sv  = Vectors.sparse(3, Seq((0, 2.0), (2, 8.0)))
    val pos = LabeledPoint(1.0, Vectors.dense(2.0, 0.0, 8.0))
    val neg = LabeledPoint(0.0, Vectors.sparse(3, Array(0, 2), Array(2.0, 8.0)))

    println(dv)
    println(sv1)
    println(sv)
    println(pos)
    println(neg)
  }
}
